using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.SessionState;

/// <summary>
/// Summary description for SessionHandler
/// </summary>
public class SessionHandler
{
    #region Private fields
    private static HttpSessionState mSession
    {
        get
        {
            return HttpContext.Current.Session;
        }
    }
    #endregion

    public SessionHandler()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    #region Public properties

    public static string SelectedTheme
    {
        get
        {
            return mSession["_SelectedTheme"] as string;
        }
        set
        {
            mSession["_SelectedTheme"] = value;
        }
    }

    public static MembershipUser CurrentUser
    {
        get
        {
            return mSession["_CurrentUser"] as MembershipUser;
        }
        set
        {
            mSession["_CurrentUser"] = value;
        }
    }

    #endregion

    #region Public methods

    public static void Put(string key, object value)
    {
        mSession["key"] = value;
    }

    public static object Get(string key)
    {
        return mSession["key"];
    }

    public static void Abandon()
    {
        mSession.Abandon();
    }

    public static void Clear()
    {
        mSession.Clear();
    }

    #endregion
}
